package com.ruoyi.shop.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.SettlementMapper;
import com.ruoyi.shop.domain.Settlement;
import com.ruoyi.shop.service.ISettlementService;

/**
 * 店铺结算Service业务层处理
 *

 * @date 2023-07-23
 */
@Service
public class SettlementServiceImpl implements ISettlementService
{
    @Autowired
    private SettlementMapper settlementMapper;

    /**
     * 查询店铺结算
     *
     * @param id 店铺结算主键
     * @return 店铺结算
     */
    @Override
    public Settlement selectSettlementById(Long id)
    {
        return settlementMapper.selectSettlementById(id);
    }

    /**
     * 查询店铺结算列表
     *
     * @param settlement 店铺结算
     * @return 店铺结算
     */
    @Override
    public List<Settlement> selectSettlementList(Settlement settlement)
    {
        return settlementMapper.selectSettlementList(settlement);
    }

    /**
     * 新增店铺结算
     *
     * @param settlement 店铺结算
     * @return 结果
     */
    @Override
    public int insertSettlement(Settlement settlement)
    {
        settlement.setCreateTime(DateUtils.getNowDate());
        return settlementMapper.insertSettlement(settlement);
    }

    /**
     * 修改店铺结算
     *
     * @param settlement 店铺结算
     * @return 结果
     */
    @Override
    public int updateSettlement(Settlement settlement)
    {
        return settlementMapper.updateSettlement(settlement);
    }

    /**
     * 批量删除店铺结算
     *
     * @param ids 需要删除的店铺结算主键
     * @return 结果
     */
    @Override
    public int deleteSettlementByIds(Long[] ids)
    {
        return settlementMapper.deleteSettlementByIds(ids);
    }

    /**
     * 删除店铺结算信息
     *
     * @param id 店铺结算主键
     * @return 结果
     */
    @Override
    public int deleteSettlementById(Long id)
    {
        return settlementMapper.deleteSettlementById(id);
    }
}
